var arr = [5,8,6,1,3,4].sort((a,b)=>{a-b})
console.log(arr)